package xyz.xtt.equity.entity;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户权益表
 * </p>
 *
 * @author dale
 * @since 2025-02-10
 */
@Data
@Builder
@Accessors(chain = true)
@TableName("tbl_user_benefit")
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "TblUserBenefit对象", description = "用户权益表")
public class TblUserBenefit implements Serializable {

	private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键")
    @TableId("user_benefit_id")
    private Long userBenefitId;

    @ApiModelProperty("通通app用户id")
    private Long appUserId;

    @ApiModelProperty("权益id")
    private Long benefitId;

    @ApiModelProperty("权益项目： PRIORITY_BUY（优先购买权）、FREE_MINT（免费铸造数量）、AI_PIC_THEME（AI图片风格）、VIP_TAG（VIP身份标识）")
    private String benefitCode;

    @ApiModelProperty("权益数量：  -1代表不限量 >=0 代表实际权益数量")
    private Integer benefitNum;

    @ApiModelProperty("权益剩余数量，取值范围参考right_num字段")
    private Integer benefitRemain;

    @ApiModelProperty("开始生效时间")
    private LocalDateTime startTime;

    @ApiModelProperty("过期时间，当服务器时间等于或晚于该时间时权益自动失效。永不失效的权益其过期时间为：9999-12-31 23:59:59")
    private LocalDateTime expireAt;

    @ApiModelProperty("权益来源：BUY_NFT_VIP_MONTH(购买数藏藏vip)，BUY_NFT_VIP_SEASON，BUY_NFT_VIP_YEAR")
    private String sourceType;

    @ApiModelProperty("权益来源关联业务id（当权益来源为BUY_NFT_VIP时此字段存储资产交易记录表id）")
    private Long sourceRefId;

    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty("最后一次更新时间")
    private LocalDateTime updateTime;

    @ApiModelProperty("是否删除：0-否，1-是")
    private Integer isDel;

    @ApiModelProperty("权益状态：0-正常，1-已冻结")
    private Integer benefitStatus;

    @ApiModelProperty("权益购买(发放)记录id")
    private Long benefitPurchaseRecordId;

    @ApiModelProperty("权益冻结时间")
    private LocalDateTime blockTime;
}
